package com.wbt.bambootown.mvp.presenter;


import com.wbt.bambootown.entity.CameraPic;
import com.wbt.bambootown.entity.DetailData;
import com.wbt.bambootown.mvp.contract.CameraPicContract;
import com.wbt.bambootown.mvp.contract.IconDataContract;
import com.wbt.bambootown.mvp.frame.ActivityPresenter;
import com.wbt.bambootown.mvp.model.CameraPicModel;
import com.wbt.bambootown.mvp.model.IconDataModel;
import com.wbt.bambootown.rx.FilterSubscriber;

import java.util.List;

public class IconDataPresenter extends ActivityPresenter<IconDataModel,IconDataContract.View> implements IconDataContract.Presenter{
    public static final String TAG = "IconDataPresenter";

    @Override
    public void getHistoryData(int id, String beginTime, String endTime) {
        addSubscription(getModel().getHistoryData(id, beginTime, endTime), new FilterSubscriber<List<DetailData>>() {
            @Override
            public void onError(int errorCode, String errorMsg) {
                getView().showError(errorMsg);
            }

            @Override
            public void onNext(List<DetailData> detailDatas) {
                getView().showDataSuccess(detailDatas);
            }
        });
    }
}
